package com.lilosoft.business.controller;

import com.lilosoft.business.task.DeleErrorInfoTask;
import com.lilosoft.business.task.SynchronousPreCity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 小峰
 * Date: 2019-08-29
 * Time: 16:02
 */
@Controller
public class HomeController {

    @Autowired
    private SynchronousPreCity synchronousPreCity;
    @Autowired
    private DeleErrorInfoTask deleErrorInfoTask;

    @RequestMapping("/subject")
    public String subject(Date beginDate, Date endDate) {
        System.out.println(beginDate + "开始与结束时间:" + endDate);
        synchronousPreCity.invokeSynchronousByDate(beginDate, endDate);
        //synchronousPreCity.invokeSynchronousByCaseId("1907040000014");
        return "index.html";
    }

    @RequestMapping("/errorInfo")
    public String invokeErrorInfo() {
        System.out.println("处理错误信息");
        deleErrorInfoTask.invokeDelete();
        return "index.html";
    }
}
